package com.nbsaas.boot.ai.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.math.BigDecimal;
import java.util.Date;

/**
 * AI预测结果实体类
 * 
 * @author 系统生成
 */
@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "AI预测结果", model = "AI预测结果")
@Entity
@Table(name = "bs_ai_prediction")
@Comment("AI预测结果表")
public class AiPrediction extends AbstractEntity {

    @Comment("模型ID")
    @FormField(title = "模型ID", sortNum = "1", grid = true, type = InputType.select)
    @Column(name = "model_id")
    private Long modelId;

    @Comment("目标日期")
    @FormField(title = "目标日期", sortNum = "2", type = InputType.date, grid = true)
    @Column(name = "target_date")
    private Date targetDate;

    @Comment("预测值")
    @FormField(title = "预测值", sortNum = "3", grid = true, type = InputType.el_input_number)
    @Column(name = "predicted_value", precision = 15, scale = 2)
    private BigDecimal predictedValue;

    @Comment("置信度")
    @FormField(title = "置信度", sortNum = "4", grid = true, type = InputType.el_input_number)
    @Column(name = "confidence_level", precision = 5, scale = 2)
    private BigDecimal confidenceLevel;

    @Comment("实际值")
    @FormField(title = "实际值", sortNum = "5", grid = true, type = InputType.el_input_number)
    @Column(name = "actual_value", precision = 15, scale = 2)
    private BigDecimal actualValue;

    @Comment("准确率")
    @FormField(title = "准确率", sortNum = "6", grid = true, type = InputType.el_input_number)
    @Column(name = "accuracy_rate", precision = 5, scale = 2)
    private BigDecimal accuracyRate;

    @Comment("预测时间")
    @FormField(title = "预测时间", sortNum = "7", type = InputType.date, grid = true)
    @Column(name = "prediction_time")
    private Date predictionTime;

    @Comment("预测类型")
    @SearchItem(name = "predictionType", key = "predictionType", label = "预测类型")
    @FormField(title = "预测类型", sortNum = "8", grid = true, type = InputType.select)
    @Column(name = "prediction_type", length = 50)
    private String predictionType; // SALES-销售预测, INVENTORY-库存预测, PRICE-价格预测, DEMAND-需求预测

    @Comment("预测状态")
    @FormField(title = "预测状态", sortNum = "9", grid = true, type = InputType.select)
    @Column(name = "prediction_status", length = 20)
    private String predictionStatus; // PENDING-待验证, VERIFIED-已验证, INVALID-无效

    @Comment("预测描述")
    @FormField(title = "预测描述", sortNum = "10", type = InputType.textarea)
    @Column(name = "description", length = 1000)
    private String description;
} 